<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>易商金融车贷贷前信息管理系统--易商贷前系统</title>
<link rel="stylesheet" type="text/css" href="<?php echo BASE_STYLE;?>/css/index.css" />
<link rel="stylesheet" type="text/css" href="<?php echo BASE_STYLE;?>/css/admin.css" />

<script type="text/javascript" src="<?php echo BASE_STYLE;?>/js/jquery.js"></script>
<script type="text/javascript" src="<?php echo BASE_STYLE;?>/js/jquery.form.js"></script>
<script type="text/javascript" src="<?php echo BASE_STYLE;?>/js/dyhl.form.js"></script>

</head>

<body class="login-bg">

<div class="login-box">
	<form class="login-box-form J-ajaxForm" action="/auth/dologin/" method="post">
    	<dl class="login-box-dl">
        	<dt class="error-message J-error-message"></dt>
            <dd>
            	<input type="text" class="J-username" name="u_name" />
            </dd>
            <dd class="mt10 mb20">
            	<input type="password" name="u_password" class="mr5 J-password" />
                <a href="/auth/getpwd/" style="text-decoration:underline;">忘记密码?</a>
            </dd>
            <dd>
				<input type="hidden" name="ajax" value="1">
            	<input type="submit" class="J-submit" value="" style="width:120px; height:35px; cursor:pointer; background:none; border:none;" />
            </dd>
        </dl>
        
    </form>
</div>
<script>
	$(document).ready(function(e) {
        $(".J-submit").on('click',function(){
			$(this).dyhlForm({
				beforefunction:function(){
					if($(".J-username").val() == ''){
						$(".J-error-message").html('请填写用户名!');
						return false;	
					}
					if($(".J-password").val() == ''){
						$(".J-error-message").html('请填写密码!');
						return false;	
					}
					
					$(".J-submit").prop('disabled',true);
				},
				nofunction:function(){
					$(".J-submit").prop('disabled',false);
				},
				sucessfunction:function(data){
					$(".J-submit").prop('disabled',false);
					if(data['success']){
						window.location.href = data['url'];	
					}else{
						$(".J-error-message").html(data['msg']);	
					}
				}	
			});	
		});
    });
</script>
</body>
</html>
